# 添加代理
# from selenium import webdriver
#
# options = webdriver.ChromeOptions()
# options.add_argument("--user-data-dir=C:/Users/Administrator/AppData/Local/Google/Chrome/User Data/Default")
# options.add_argument('--proxy-server=http://s430.kdltps.com:15818')  # 隧道域名:端口号
# driver = webdriver.Chrome(options=options)
# driver.get("https://www.httpbin.org/get")


# 隐藏自动化身份
# from selenium import webdriver
#
# options = webdriver.ChromeOptions()
# options.add_argument("--user-data-dir=C:/Users/Administrator/AppData/Local/Google/Chrome/User Data/Default")
# # 此步骤很重要，设置为开发者模式，防止被各大网站识别出来使用了Selenium
# options.add_experimental_option('excludeSwitches', ['enable-automation'])
# # 就是这一行告诉chrome去掉了webdriver痕迹，令navigator.webdriver=false，极其关键
# options.add_argument("--disable-blink-features=AutomationControlled")
# driver = webdriver.Chrome(options=options)
# driver.get("https://www.taobao.com/")


# # 隐藏浏览器  无头浏览器 headless 无界面浏览器
# from selenium import webdriver
#
# options = webdriver.ChromeOptions()
# options.add_argument("--user-data-dir=C:/Users/Administrator/AppData/Local/Google/Chrome/User Data/Default")
# options.set_headless(True)
# driver = webdriver.Chrome(options=options)
# driver.get("https://www.taobao.com/")
# with open("taobao.html", "w", encoding="utf-8") as f:
#     f.write(driver.page_source)
#
# driver.quit()


